package com.anjubao.parking.municipal.common.config;

import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ClassPathResource;

import ch.qos.logback.core.PropertyDefinerBase;

public class LogbackAppName extends PropertyDefinerBase {

	public static final Properties p;
	static {
		p = readConfig();
	}

	@Override
	public String getPropertyValue() {
		return p.getProperty("spring.application.name");
	}

	public static Properties readConfig() {
		YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
		ClassPathResource classPathResource = new ClassPathResource("bootstrap.yml", LogbackAppName.class.getClassLoader());
		yaml.setResources(classPathResource);// File引入
		return yaml.getObject();
	}

}
